{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/components/DialogInput/index.tsx\";\nimport React from \"react\";\nimport { IconButton, TextField } from \"@mui/material\";\nimport classNames from \"classnames\";\nimport data from '@emoji-mart/data';\nimport Picker from '@emoji-mart/react';\nimport { UploadFiles } from \"../../components\";\nimport './DialogInput.scss';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-dev-runtime\";\nconst DialogInput = _ref => {\n  var _images$items;\n  let {\n    toggleEmojiPicker,\n    emojiPickerVisible,\n    setEmojiPickerVisible,\n    value,\n    textField,\n    setTextField,\n    maxSizeMessage,\n    uploadDocumentHandler,\n    handleSendMessage,\n    pickerRef,\n    addEmoji,\n    flagForStyle,\n    textAreaRef,\n    images,\n    voice,\n    callbackOnDeleteContent,\n    onRecord,\n    onStopRecording,\n    isRecording\n  } = _ref;\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"dialogInput\",\n    children: [(((_images$items = images.items) === null || _images$items === void 0 ? void 0 : _images$items.length) || (voice === null || voice === void 0 ? void 0 : voice.id)) && !isRecording && /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"dialogInput-upload\",\n      style: !flagForStyle ? {\n        bottom: `100px`\n      } : {\n        bottom: `117px`\n      },\n      children: images.items.length > 0 && !(voice !== null && voice !== void 0 && voice.id) && /*#__PURE__*/_jsxDEV(UploadFiles, {\n        uploaded: images,\n        callbackOnDeleteContent: callbackOnDeleteContent\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 44,\n        columnNumber: 29\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 36,\n      columnNumber: 21\n    }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"dialogInput-form\",\n      style: isRecording ? {\n        justifyContent: \"space-between\"\n      } : {},\n      children: [!isRecording && /*#__PURE__*/_jsxDEV(_Fragment, {\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          ref: pickerRef,\n          className: \"dialogInput-emoji\",\n          children: [/*#__PURE__*/_jsxDEV(IconButton, {\n            type: \"button\",\n            className: \"dialogInput-form-smile\",\n            onClick: () => toggleEmojiPicker()\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 54,\n            columnNumber: 33\n          }, this), emojiPickerVisible && /*#__PURE__*/_jsxDEV(\"div\", {\n            style: !flagForStyle ? {\n              bottom: `90px`\n            } : {\n              bottom: `117px`\n            },\n            className: \"dialogInput__emoji-picker\",\n            children: /*#__PURE__*/_jsxDEV(Picker, {\n              onEmojiSelect: emojiData => {\n                addEmoji(emojiData.shortcodes);\n              },\n              set: \"apple\",\n              theme: \"light\",\n              locale: \"ru\",\n              data: data\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 67,\n              columnNumber: 41\n            }, this)\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 60,\n            columnNumber: 37\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 53,\n          columnNumber: 29\n        }, this), /*#__PURE__*/_jsxDEV(TextField, {\n          className: classNames(\"dialogInput-form-input\", {\n            \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n          }),\n          onChange: e => setTextField(e.target.value),\n          onKeyUp: e => {\n            if (e.key === 'Enter') {\n              handleSendMessage();\n              setEmojiPickerVisible(false);\n            }\n          },\n          value: textField,\n          variant: \"outlined\",\n          label: textField.length > 0 && `${textField.length}/${maxSizeMessage}` || null,\n          multiline: true,\n          rows: flagForStyle ? 3 : 1,\n          placeholder: \"\\u0412\\u0432\\u0435\\u0434\\u0438\\u0442\\u0435 \\u0441\\u043E\\u043E\\u0431\\u0449\\u0435\\u043D\\u0438\\u0435\",\n          inputProps: {\n            'aria-label': 'Введите сообщение'\n          },\n          inputRef: textAreaRef\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 90,\n          columnNumber: 29\n        }, this), /*#__PURE__*/_jsxDEV(IconButton, {\n          type: \"button\",\n          className: \"dialogInput-form-image\",\n          children: /*#__PURE__*/_jsxDEV(\"input\", {\n            type: \"file\",\n            accept: \"image/*\",\n            multiple: true,\n            onChange: e => uploadDocumentHandler(e)\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 114,\n            columnNumber: 33\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 110,\n          columnNumber: 29\n        }, this)]\n      }, void 0, true), value && /*#__PURE__*/_jsxDEV(IconButton, {\n        type: \"button\",\n        className: \"dialogInput-form-send\"\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 125,\n        columnNumber: 29\n      }, this) || !isRecording && /*#__PURE__*/_jsxDEV(IconButton, {\n        type: \"button\",\n        className: \"dialogInput-form-microphone\",\n        onClick: onRecord\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 131,\n        columnNumber: 33\n      }, this) || /*#__PURE__*/_jsxDEV(_Fragment, {\n        children: [/*#__PURE__*/_jsxDEV(\"span\", {\n          className: \"dialogInput-form-info\",\n          children: \"\\u0418\\u0434\\u0435\\u0442 \\u0437\\u0430\\u043F\\u0438\\u0441\\u044C\"\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 138,\n          columnNumber: 37\n        }, this), /*#__PURE__*/_jsxDEV(IconButton, {\n          type: \"button\",\n          className: \"dialogInput-form-stop\",\n          onClick: onStopRecording\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 139,\n          columnNumber: 37\n        }, this)]\n      }, void 0, true)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 48,\n      columnNumber: 17\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 34,\n    columnNumber: 13\n  }, this);\n};\n_c = DialogInput;\nexport default DialogInput;\nvar _c;\n$RefreshReg$(_c, \"DialogInput\");","map":{"version":3,"names":["React","IconButton","TextField","classNames","data","Picker","UploadFiles","DialogInput","toggleEmojiPicker","emojiPickerVisible","setEmojiPickerVisible","value","textField","setTextField","maxSizeMessage","uploadDocumentHandler","handleSendMessage","pickerRef","addEmoji","flagForStyle","textAreaRef","images","voice","callbackOnDeleteContent","onRecord","onStopRecording","isRecording","items","length","id","bottom","justifyContent","emojiData","shortcodes","e","target","key"],"sources":["/data/messenger.client/src/components/DialogInput/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {IconButton, TextField} from \"@mui/material\";\nimport classNames from \"classnames\";\nimport data from '@emoji-mart/data'\nimport Picker from '@emoji-mart/react'\nimport {DialogInputProps} from \"../../models/props/DialogInputProps\";\nimport {UploadFiles} from \"../../components\";\nimport './DialogInput.scss';\n\nconst DialogInput: React.FC<DialogInputProps> = (\n    {\n        toggleEmojiPicker,\n        emojiPickerVisible,\n        setEmojiPickerVisible,\n        value,\n        textField,\n        setTextField,\n        maxSizeMessage,\n        uploadDocumentHandler,\n        handleSendMessage,\n        pickerRef,\n        addEmoji,\n        flagForStyle,\n        textAreaRef,\n        images,\n        voice,\n        callbackOnDeleteContent,\n        onRecord,\n        onStopRecording,\n        isRecording\n    }\n) => {\n    return (\n            <div className=\"dialogInput\">\n                {(images.items?.length || voice?.id) && !isRecording &&\n                    <div className=\"dialogInput-upload\"\n                         style={\n                             !flagForStyle?\n                                 {bottom: `100px`}:\n                                 {bottom: `117px`}\n                         }\n                    >\n                        {images.items.length > 0 && !voice?.id &&\n                            <UploadFiles uploaded={images} callbackOnDeleteContent={callbackOnDeleteContent} />\n                        }\n                    </div>\n                }\n                <div className=\"dialogInput-form\"\n                    style={isRecording? {justifyContent: \"space-between\"}: {}}\n                >\n                    {!isRecording && (\n                        <>\n                            <div ref={pickerRef} className=\"dialogInput-emoji\">\n                                <IconButton\n                                    type=\"button\"\n                                    className='dialogInput-form-smile'\n                                    onClick={() => toggleEmojiPicker()}\n                                />\n                                {emojiPickerVisible && (\n                                    <div\n                                        style={\n                                            !flagForStyle?\n                                                {bottom: `90px`}:\n                                                {bottom: `117px`}\n                                        }\n                                        className=\"dialogInput__emoji-picker\">\n                                        <Picker\n                                            onEmojiSelect={\n                                                (emojiData: {\n                                                    id: string;\n                                                    name: string;\n                                                    /** emoji */\n                                                    native: string;\n                                                    /** unicode */\n                                                    unified: string;\n                                                    keywords: string[];\n                                                    shortcodes: string;\n                                                }) => {\n                                                    addEmoji(emojiData.shortcodes);\n                                                }\n                                            }\n                                            set=\"apple\"\n                                            theme=\"light\"\n                                            locale=\"ru\"\n                                            data={data}\n                                        />\n                                    </div>\n                                )}\n                            </div>\n                            <TextField\n                                className={classNames(\"dialogInput-form-input\", {\n                                    \"dialogInput-form-input--error\": textField.length > maxSizeMessage\n                                })}\n                                onChange={e => (setTextField(e.target.value))}\n                                onKeyUp={e => {\n                                    if (e.key === 'Enter') {\n                                        handleSendMessage();\n                                        setEmojiPickerVisible(false);\n                                    }\n                                }}\n                                value={textField}\n                                variant=\"outlined\"\n                                label={((textField.length > 0 && `${textField.length}/${maxSizeMessage}`) || null)}\n                                multiline\n                                rows={flagForStyle? 3: 1}\n                                placeholder=\"Введите сообщение\"\n                                inputProps={{ 'aria-label': 'Введите сообщение' }}\n                                inputRef={textAreaRef}\n                            />\n                            <IconButton\n                                type=\"button\"\n                                className='dialogInput-form-image'\n                            >\n                                <input\n                                    type=\"file\"\n                                    accept=\"image/*\"\n                                    multiple={true}\n                                    onChange={e => uploadDocumentHandler(e)}\n                                />\n                            </IconButton>\n                        </>\n                    )}\n                    {\n                        (value &&\n                            <IconButton\n                                type=\"button\"\n                                className='dialogInput-form-send'\n                            />) ||\n                        (\n                            (!isRecording &&\n                                <IconButton\n                                    type=\"button\"\n                                    className='dialogInput-form-microphone'\n                                    onClick={onRecord}\n                                />\n                            ) || (\n                                <>\n                                    <span className=\"dialogInput-form-info\">Идет запись</span>\n                                    <IconButton\n                                        type=\"button\"\n                                        className='dialogInput-form-stop'\n                                        onClick={onStopRecording}\n                                    />\n                                </>\n                            )\n                        )\n                    }\n                </div>\n            </div>\n    );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